package com.autumn.sms;

import java.util.Map;

import org.apache.commons.collections.map.CaseInsensitiveMap;

/**
 * 基于 Map 短信通道配置
 * 
 * @author 杨昌国 2018-12-07 13:08:09
 */
public class MapSmsChannelConfigure implements SmsChannelConfigure {

	@SuppressWarnings("unchecked")
	private Map<String, Object> paramMap = new CaseInsensitiveMap();

	@Override
	public Object get(String name) {
		if (this.getParamMap() == null) {
			return null;
		}
		return this.getParamMap().get(name);
	}

	@Override
	public Object get(String name, Object defaultValue) {
		Object value = this.get(name);
		if (value == null) {
			value = defaultValue;
		}
		return value;
	}

	/**
	 * 获取参数 Map
	 * 
	 * @return
	 */
	public Map<String, Object> getParamMap() {
		return paramMap;
	}

	/**
	 * 设置参数 Map
	 * 
	 * @param paramMap 参数 map
	 */
	public void setParamMap(Map<String, Object> paramMap) {
		this.paramMap = paramMap;
	}

}
